#!/bin/bash
# 获取PID

ajk_pid=-1;
ajk_pid=`/usr/local/jdk1.8.0_73/bin/jps -ml | grep "ajk-server-core-1.0.war" |/bin/awk '{print $1}'`;
if [ $ajk -gt 0 ]; then
	echo "you will kill the pid($ajk_pid) of ajk.war";
	/bin/kill -9 $ajk_pid;
fi

#启动ajk.war

cd /root/code/ajk
/usr/bin/git pull origin master
/usr/local/gradle-2.3/bin/gradle clean build -x test 

/usr/bin/nohup /usr/local/jdk1.8.0_73/bin/java -jar /root/code/ajk/ajk-server-core/build/libs/ajk-server-core-1.0.war com.ajk.server.AjkAplication &
